package com.powell.health.activity;

import android.os.Bundle;
import com.powell.health.fragment.ItemEntryFragment;
import com.powell.health.fragment.ItemListFragment;

/**
 * Created with IntelliJ IDEA.
 * User: tpowell
 * Date: 2/21/13
 * Time: 9:59 AM
 * To change this template use File | Settings | File Templates.
 */
public class ItemEntryActivity extends AbstractHealthActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (isLandScape()) {
            return;
        }
        createNewItemEntryFragment(savedInstanceState);
    }

    private void createNewItemEntryFragment(Bundle savedInstanceState) {
        if (savedInstanceState == null) {
            ItemEntryFragment itemEntryFragment = new ItemEntryFragment();
            itemEntryFragment.setArguments(getIntent().getExtras());
            getFragmentManager().beginTransaction().add(android.R.id.content, itemEntryFragment).commit();
        }
    }
}
